package com.haiya.state.threadstate;

public class BlockedState extends ThreadState {
    public BlockedState() {
        threadName = "阻塞状态";
        System.out.println("当前线程处于阻塞状态.~~~~~");
    }

    public void resume(ThreadContext context) {
        System.out.print("调用resume()方法-->");
        if (threadName.equals("阻塞状态")) {
            context.setState(new RunnableState());
        } else {
            System.out.println("当前线程不是阻塞状态，不能调用resume方法.");
        }
    }
}
